<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>38旋转案例</title>
    <style>
        .box {
            float: left;
            margin: 10px;
            width: 100px;
            height: 100px;
            background-color: seagreen;
            overflow: hidden;
        }
        
        .box:before {
            content: '旋转案例';
            display: block;
            width: 100%;
            height: 100%;
            transform: rotate(90deg);
            transform-origin: left bottom;
            transition: all 0.5s;
            background-color: rosybrown;
            color: #fff;
            text-align: center;
            line-height: 100px;
        }
        
        .box:hover::before {
            transform: rotate(0deg);
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <div class="box"></div>
</body>

</html>